#ifndef YCBASEPACKS_H
#define YCBASEPACKS_H
#include <QHash>
#include <QString>

namespace yc {

struct Pack
{
    enum Mode { kOptional = 0, kNecessary };

    QString version;
    QString next;
    QString url;
    QString date;
    QString md5;
    QString comment;
    int size;
    int mode;
    QString app_version;
};

class Packs
{
public:
    explicit Packs(const QString& file_name);

    bool exist(const QString& verison) const { return packs_.contains(verison); }
    Pack pack(const QString& version) const { return packs_.value(version); }
    QList<Pack> nextPacks(const QString& version) const;

private:
    QHash<QString, Pack> packs_;
};

} // namespace yc

#endif // YCBASEPACKS_H
